package com.twu.biblioteca.menu;

import com.twu.biblioteca.BibliotecaApp;
import com.twu.biblioteca.model.Movie;
import com.twu.biblioteca.model.User;

import java.io.PrintStream;

/**
 * Created with IntelliJ IDEA.
 * User: Aaron Edwards
 * Date: 10/10/13
 * Time: 7:58 AM
 * Email: aedwards@thoughtworks.com
 */
public class ViewMoviesMenuItem implements IMenuItem {
    @Override
    public String getMenuTitleForUser(User currentUser) {
        return "View Library Movie Collection";
    }

    @Override
    public void doAction(BibliotecaApp bibliotecaApp) {
        PrintStream output = bibliotecaApp.getOutputStream();
        output.println("Movie Collection");

        for(Movie movie: bibliotecaApp.getMovieCollection().getItemList()){
            output.println(movie.getDisplayString());
        }
    }


}
